class Player(object):
    def __init__(self, name, age, city):
        self.name = name
        self.age = age
        self.city = city


mia = Player('mia', 19, '北京')
mia.city = '杭州'  # 可以修改值
tom = Player('tom', 20, '上海')
tom.height = 170  # 可以新增对象的特殊属性
print(mia.__dict__)  # 获取（实例）对象的所有属性
print(tom.__dict__)


# 武器：名字  等级  攻击值
class Weapon(object):
    def __init__(self, name, level, damage):
        self.name = name
        self.level = level
        self.damage = damage


gun = Weapon('MagicGun', 3, 1000)
print(gun.__dict__)
